import 'package:flutter/material.dart';
import 'package:flutter/cupertino.dart';
import 'package:lai_zhan/page/LoginPage.dart';
import 'package:lai_zhan/page/RegisterPage.dart';
import 'package:lai_zhan/page/CompleteUserInfoPage.dart';
import 'package:lai_zhan/page/IndexPage.dart';
import 'package:lai_zhan/page/ActivityPage.dart';
import 'package:lai_zhan/page/ShopPage.dart';
import 'package:lai_zhan/page/PhotoPreViewPage.dart';
import 'package:lai_zhan/page/CourseListPage.dart';
import 'package:lai_zhan/page/CoursePage.dart';
import 'package:lai_zhan/page/ShopListPage.dart';
import 'package:lai_zhan/page/CoachListPage.dart';
import 'package:lai_zhan/page/CoachPage.dart';
import 'package:lai_zhan/page/ActivityListPage.dart';

class NavigatorUtil {

  //主页
  static goIndex(BuildContext context) {
    Navigator.of(context).pushReplacementNamed(IndexPage.rName);
  }
  //登陆
  static goLogin(BuildContext context) {
    Navigator.of(context).pushNamed(LoginPage.rName);
  }
  //返回
  static goBack(BuildContext context) {
    Navigator.of(context).pop();
  }
  //注册
  static goRegister(BuildContext context) {
    Navigator.of(context).pushNamed(RegisterPage.rName);
  }
  //完善信息
  static goComplete(BuildContext context) {
    Navigator.of(context).pushReplacementNamed(CompleteUserInfoPage.rName);
  }
  //活动详情
  static goActivityPage(BuildContext context,[dynamic data]) {
    Navigator.push(context, new MaterialPageRoute(builder: (BuildContext context){
      return new ActivityPage(activity: data,);
    }));
  }
  //活动列表
  static goActivityList(BuildContext context) {
    Navigator.push(context, new MaterialPageRoute(builder: (BuildContext context){
      return new ActivityListPage();
    }));
  }
  //商店详情
  static goShopPage(BuildContext context,[dynamic data]) {
    Navigator.push(context, new MaterialPageRoute(builder: (BuildContext context){
      return new ShopPage(shop: data,);
    }));
  }
  //门店列表
  static goShopList(BuildContext context) {
    Navigator.push(context, new MaterialPageRoute(builder: (BuildContext context){
      return new ShopListPage();
    }));
  }
  //图片预览
  static goPhotoPreView(BuildContext context,[dynamic data]){
    Navigator.push(context, new MaterialPageRoute(builder: (BuildContext context){
      return new PhotoPreViewPage(imageUrl: data);
    }));
  }
  //团体课列表
  static goCourseList(BuildContext context){
    Navigator.push(context, new MaterialPageRoute(builder: (BuildContext context){
      return new CourseListPage();
    }));
  }
  //课程详情页面
  static goCoursePage(BuildContext context,[dynamic data]){
    Navigator.push(context, new MaterialPageRoute(builder: (BuildContext context){
      return new CoursePage();
    }));
  }
  //私教课列表
  static goCoachList(BuildContext context) {
    Navigator.push(context, new MaterialPageRoute(builder: (BuildContext context){
      return new CoachListPage();
    }));
  }
  //私教课详情
  static goCoachPage(BuildContext context,[dynamic data]) {
    Navigator.push(context, new MaterialPageRoute(builder: (BuildContext context){
      return new CoachPage();
    }));
  }
}